Invoking calls to OS from DXL script

My script generates a traceability report in HTML. Works fine, fully guaranteed.
The problem is the the code which attempts to open the file in the browser when a checkbox is checked.

string strFile = "C:\\temp\\CL_Trace.html"

bool fileOpen = get (openDBE)
if (fileOpen) {
string outCmd = "cmd /C start " strFile ""
system (outCmd)
}

The above works fine until my users replace the default path (using a callback not shown here) to their desktop. Thanks to Microsoft's infinite wisdom the desktop pathname starts with "C:\Documents and Settings\.." which has spaces in it. My code then breaks.

Can anyone think of a way of coding this to be tolerant of embedded spaces?
SystemAdmin - Tue Sep 15 18:28:37 EDT 2009

Re: Invoking calls to OS from DXL script
SystemAdmin - Wed Sep 16 02:38:33 EDT 2009

Probably you could bypass that problem by adding quotation marks around your strFile, i.e.

string outCmd = "cmd /C start \"" strFile "\""

...well this did not work for me...

But what did work without any other changes was to replace your

string outCmd = "cmd /C start " strFile ""
system (outCmd)

with just

activateURL(strFile)

Re: Invoking calls to OS from DXL script
SystemAdmin - Wed Sep 16 09:46:51 EDT 2009

SystemAdmin - Wed Sep 16 02:38:33 EDT 2009
Probably you could bypass that problem by adding quotation marks around your strFile, i.e.

string outCmd = "cmd /C start \"" strFile "\""

...well this did not work for me...

But what did work without any other changes was to replace your

string outCmd = "cmd /C start " strFile ""
system (outCmd)

with just

activateURL(strFile)

Excellent, that solution worked perfectly, of course.

Yep, it's right there in DXL Help, though how I would have found it on my own I don't know.

Thanks again.

Re: Invoking calls to OS from DXL script
Bosch - Thu Sep 08 05:03:19 EDT 2011

SystemAdmin - Wed Sep 16 09:46:51 EDT 2009
Excellent, that solution worked perfectly, of course.

Yep, it's right there in DXL Help, though how I would have found it on my own I don't know.

Thanks again.

Hello,

I have a dxl script were it will generate a report in Excel sheet, but i want to generate the ouptut in html format.
Kindly help me out how to output the data into a html.

Attached is the dxl script were it will generate the report in excel.
kindly have a look and let me know how to out put the data in html.

Thank you!

Regards,
Shruthi
Attachments

attachment_14680486_GetListOfRMs2.dxl

Re: Invoking calls to OS from DXL script
OurGuest - Thu Sep 08 07:19:19 EDT 2011

Bosch - Thu Sep 08 05:03:19 EDT 2011
Hello,

I have a dxl script were it will generate a report in Excel sheet, but i want to generate the ouptut in html format.
Kindly help me out how to output the data into a html.

Attached is the dxl script were it will generate the report in excel.
kindly have a look and let me know how to out put the data in html.

Thank you!

Regards,
Shruthi

Looks like the easiest would be either modify the dxl to tell excel to save as html or manually save the excel file as html.

Re: Invoking calls to OS from DXL script
Bosch - Fri Sep 09 00:35:20 EDT 2011

OurGuest - Thu Sep 08 07:19:19 EDT 2011
Looks like the easiest would be either modify the dxl to tell excel to save as html or manually save the excel file as html.

Hello,

I don't want to change it manually , i want directly to output the data to HTML
On running the dxl script the out put should be opened in the HTML or save the file as HTML with the output.

I have no clue how they will out put the data to HTML like excel.

May i know what would be the syntax for it.

Thank you!

Regards,
shruthi

Re: Invoking calls to OS from DXL script
Mathias Mamsch - Fri Sep 09 03:27:19 EDT 2011

Bosch - Fri Sep 09 00:35:20 EDT 2011
Hello,

I don't want to change it manually , i want directly to output the data to HTML
On running the dxl script the out put should be opened in the HTML or save the file as HTML with the output.

I have no clue how they will out put the data to HTML like excel.

May i know what would be the syntax for it.

Thank you!

Regards,
shruthi

You really need to stop pulling some old posts which have absolutely nothing to do with your question. Next time please open a new post for a question like this, so other users will be able to find the information. To write a HTML file you need to write to a file directly. There is no builtin HTML functionality which makes this any easier for you. So you need to build a file with HTML syntax manually. This would look something like

<HTML>
<TITLE> Title </TITLE>
<BODY> <TABLE border = 1> 
<TR> <TD> Value 1... </TD> <TD> Value 2... </TD> </TR> 
<TR> <TD> Value 2... </TD> <TD> Value 2... </TD> </TR> 
</TABLE> </BODY>
</HTML>

 


So you need to replace all the setExcelCell OLE calls in your code by the corresponding "Write to a file" code. If you do not know how to write to a file, look for 'Stream' in the forum and in the DXL help. Hope that helps, Regards, Mathias

 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

 

Re: Invoking calls to OS from DXL script
Bosch - Mon Sep 12 00:42:18 EDT 2011

Mathias Mamsch - Fri Sep 09 03:27:19 EDT 2011

You really need to stop pulling some old posts which have absolutely nothing to do with your question. Next time please open a new post for a question like this, so other users will be able to find the information. To write a HTML file you need to write to a file directly. There is no builtin HTML functionality which makes this any easier for you. So you need to build a file with HTML syntax manually. This would look something like

<HTML>
<TITLE> Title </TITLE>
<BODY> <TABLE border = 1> 
<TR> <TD> Value 1... </TD> <TD> Value 2... </TD> </TR> 
<TR> <TD> Value 2... </TD> <TD> Value 2... </TD> </TR> 
</TABLE> </BODY>
</HTML>

 


So you need to replace all the setExcelCell OLE calls in your code by the corresponding "Write to a file" code. If you do not know how to write to a file, look for 'Stream' in the forum and in the DXL help. Hope that helps, Regards, Mathias

 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

 

Hello,

sorry for pulling the existing request, since i was not knowing how to raise a new request so i just commented on the related request, but now i came to know how to create a new request.

Thanks for solution provided, i got it regarding how to display the output in HTML using stream and also the syntax for the HTML.

Thank you for your support.

Regards,
Shruthi